// Copyright (c) MatrixFramework. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using AutoMapper;
using PhotoGalleryService.Photos;

namespace PhotoGalleryService.Application;

/// <summary>
/// PhotoGallery服务AutoMapper配置
/// </summary>
public class PhotoGalleryServiceAutoMapperProfile : Profile
{
    public PhotoGalleryServiceAutoMapperProfile()
    {
        CreateMap<Photo, PhotoDto>()
            .ForMember(dest => dest.AccessUrl, opt => opt.Ignore())
            .ForMember(dest => dest.ThumbnailUrl, opt => opt.Ignore())
            .ForMember(dest => dest.MediumUrl, opt => opt.Ignore());

        CreateMap<CreateUpdatePhotoDto, Photo>()
            .ForMember(dest => dest.Id, opt => opt.Ignore())
            .ForMember(dest => dest.CreationTime, opt => opt.Ignore())
            .ForMember(dest => dest.CreatorId, opt => opt.Ignore())
            .ForMember(dest => dest.LastModificationTime, opt => opt.Ignore())
            .ForMember(dest => dest.LastModifierId, opt => opt.Ignore());
    }
}